import React from 'react'
import ReactDOM from 'react-dom'

function Mailbox(props) {
  const message = props.message
  return(
    <div>
      <h2>hello</h2>
      { message.length > 0 &&
        <h3>you have {message[0]}</h3>
      }
    </div>
  )
}

const msg = ['react', "re", "act"]

ReactDOM.render(
  <Mailbox message={ msg }/>,
  document.getElementById('root')
)